<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">公司名字</label>
                    <div class="layui-input-inline">
                        <input type="text" name="companyname" placeholder="" class="layui-input">
                    </div>
                </div>



                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">用户名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="companylogin" placeholder="" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">电话</label>
                    <div class="layui-input-inline">
                        <input type="text" name="phone" placeholder="" class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="password" placeholder="" class="layui-input">
                    </div>
                </div>

                <!--<div class="layui-form-item layui-inline">-->
                    <!--<label class="layui-form-label">账户登录token</label>-->
                    <!--<div class="layui-input-inline">-->
                        <!--<input type="text" name="token" placeholder="" class="layui-input">-->
                    <!--</div>-->
                <!--</div>-->

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">邮箱</label>
                    <div class="layui-input-inline">
                        <input type="text" name="email" placeholder="" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">资质图片</label>
                    <div class="layui-input-inline">
                        <input type="text" name="qualificationPic" placeholder="" class="layui-input">
                    </div>
                </div>


                <!--<div class="layui-form-item layui-inline">-->
                    <!--<label class="layui-form-label">创建时间</label>-->
                    <!--<div class="layui-input-inline">-->
                        <!--<input type="text" name="createTime" placeholder="" class="layui-input">-->
                    <!--</div>-->
                <!--</div>-->

                <!--<div class="layui-form-item layui-inline">-->
                    <!--<label class="layui-form-label">更新时间</label>-->
                    <!--<div class="layui-input-inline">-->
                        <!--<input type="text" name="updateTime" placeholder="" class="layui-input">-->
                    <!--</div>-->
                <!--</div>-->

                <!--<div class="layui-form-item layui-inline">-->
                    <!--<label class="layui-form-label">删除标记</label>-->
                    <!--<div class="layui-input-inline">-->
                        <!--<input type="text" name="delFlag" placeholder="" class="layui-input">-->
                    <!--</div>-->
                <!--</div>-->

                <!--<div class="layui-form-item layui-inline">-->
                    <!--<label class="layui-form-label">审核状态</label>-->
                    <!--<div class="layui-input-inline">-->
                        <!--<input type="text" name="delFlag" placeholder="" class="layui-input">-->
                    <!--</div>-->
                <!--</div>-->

                <!--<div class="layui-form-item layui-inline">-->
                    <!--<label class="layui-form-label">登录次数</label>-->
                    <!--<div class="layui-input-inline">-->
                        <!--<input type="text" name="firstLogin" placeholder="" class="layui-input">-->
                    <!--</div>-->
                <!--</div>-->
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/pear.js"></script>
<script>
    layui.use(['form','jquery'],function(){
        let form = layui.form;
        let $ = layui.jquery;

        form.on('submit(user-save)', function(data){
            console.log(data)
            $.ajax({
                url:'/c-company/',
                //设置请求头token
                headers: {"token":localStorage.getItem("token")},
                data: data.field,
                dataType:'json',
                type:'post',
                success:function(result){
                    if(result.code==200){
                        layer.msg(result.msg,{icon:1,time:1000},function(){
                            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                            parent.layui.table.reload("dict-table");
                        });
                    }else{
                        layer.msg(result.msg,{icon:2,time:1000});
                    }
                }
            })
            return false;
        });
    })
</script>
<script>
</script>
</body>
</html>